package com.amex.uam.dao.impl;

import java.util.List;

import org.springframework.jdbc.core.simple.ParameterizedBeanPropertyRowMapper;
import org.springframework.stereotype.Repository;

import com.amex.uam.dao.CountryRegionDao;
import com.amex.uam.model.GEO_AREA;
@Repository("countryRegionDao")
public class CountryRegionDaoImpl extends JdbcDao implements CountryRegionDao{

	@Override
	public List<GEO_AREA> loadGEOCounrty() {
		String sql = "SELECT GEO_AREA_ID ,GEO_AREA_TYPE_ID ,GEO_AREA_CD ,"
				+ "GEO_AREA_NM ,GEO_AREA_LONG_ABRV_NM ,GEO_AREA_SHRT_ABRV_NM ,POPLN_TS ,SRCE_SYS_ID "
				+ "FROM GEO_AREA "
				+ "where GEO_AREA_TYPE_ID='100440004'";
		
		return this.getJdbcTemplate().query(sql, ParameterizedBeanPropertyRowMapper.newInstance(GEO_AREA.class));
	}

	@Override
	public List<GEO_AREA> loadGEORegion() {
		String sql = "Select GEO_AREA_ID, GEO_AREA_NM "
				+ "from GEO_AREA "
				+ "where  GEO_AREA_TYPE_ID ='100440006' "
				+ "Order by GEO_AREA_NM ASC";
		return this.getJdbcTemplate().query(sql, ParameterizedBeanPropertyRowMapper.newInstance(GEO_AREA.class));
	}

}
